<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .parent{
            width: 500px;
            height: 400px;
            border: 1px solid red;
            margin: 0 auto;
            display: flex;
            /* flex-direction:row;
            flex-wrap: wrap; */
            /* justify-content: center;
            align-items: center; */
        }
        .child{
            /* width: 100px; */
            flex: 1;
            height: 60px;
            color: white;
        }
        .second{
            flex: 2;
        }
    </style>
</head>
<body>
    <div class="parent">
        <div class="child" style="background-color:red">弹性元素1</div>
        <div class="child second" style="background-color:green">弹性元素2</div>
        <div class="child" style="background-color:blue">弹性元素3</div>
        <!-- <div class="child" style="background-color:red">弹性元素1</div>
        <div class="child" style="background-color:green">弹性元素2</div>
        <div class="child" style="background-color:blue">弹性元素3</div> -->
    </div>
</body>
</html>